package br.com.amadeus.android.adapters;

import java.util.List;

import android.content.Context;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import br.com.amadeus.android.activities.home.R;
import br.com.amadeus.android.entities.Goal;

public class GoalInTaskAdapter extends BaseAdapter {
	protected static final String CATEGORIA = "Task";
	private Context context;
	private List<Goal> goals;

	public GoalInTaskAdapter(Context context, List<Goal> goals) {
		super();
		this.context = context;
		this.goals = goals;
	}

	public int getCount() {
		return this.goals.size();
	}

	public Object getItem(int pos) {
		Goal goal = this.goals.get(pos);
		return goal;
	}

	public long getItemId(int pos) {
		return pos;
	}

	public View getView(int pos, View view, ViewGroup viewGroup) {
		
		LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		View v = inflater.inflate(R.layout.amadeus_my_courses_list_detail, null);
		
		Goal goal = this.goals.get(pos);
		TextView tvGoal = (TextView) v.findViewById(R.id.tvCourseName);
		tvGoal.setText(goal.getDefinition());
		
		return v;
	}
	
}